import {createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            redirect: "/login"
        },
        {
            path: '/login',
            name: 'login',
            component: () => import('@/views/login/index.vue')
        },
        {
            path: '/user',
            name: 'user',
            component: () => import('@/views/user/index.vue'),
            redirect:"/info",
            children: [
                {
                    path: '/info',
                    name: 'info',
                    component: () => import('@/views/user/info/index.vue')
                },
                {
                    path: '/setting',
                    name: 'setting',
                    component: () => import('@/views/user/setting/index.vue')
                },
            ]
        },

    ]
})

export default router
